From: Florian Müllner Date: Thu, 8 Jul 2021 17:23:38 +0000 (+0200) Subject: shellInfo: Don't destroy source on undo X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~574^2^2~215 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=6995c2fa9f1a0b6cf673d233a0bd9f615c3093ef;p=gnome-shell.git shellInfo: Don't destroy source on undo Destroying the source from an action callback will result in the notification being destroyed twice: - source.destroy() destroys all its notifications - a notification destroys itself after an action was activated This results in unwanted log spam when attempting to dispose the notification for a second time. There is actually no good reason for destroying the source explicitly, as sources already self-destruct with their last notification. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4457 Part-of: --- diff --git a/js/ui/overview.js b/js/ui/overview.js index 529779ea8..c71b11389 100644 --- a/js/ui/overview.js +++ b/js/ui/overview.js @@ -25,16 +25,6 @@ var OVERVIEW_ACTIVATION_TIMEOUT = 0.5; var ShellInfo = class { constructor() { this._source = null; - this._undoCallback = null; - } - - _onUndoClicked() { - if (this._undoCallback) - this._undoCallback(); - this._undoCallback = null; - - if (this._source) - this._source.destroy(); } setMessage(text, options) { @@ -64,9 +54,8 @@ var ShellInfo = class { notification.update(text, null, { clear: true }); } - this._undoCallback = undoCallback; if (undoCallback) - notification.addAction(_("Undo"), this._onUndoClicked.bind(this)); + notification.addAction(_('Undo'), () => undoCallback()); this._source.showNotification(notification); }